<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/


Route::group(['prefix' => 'admin-permission'], function ($api) {

    /*
    |--------------------------------------------------------------------------
    | 权限套餐相关路由
    |--------------------------------------------------------------------------
    |
    */
    $api->group(['prefix' => 'package'], function ($packageApi) {
        $packageApi->post('', [
            'as'   => 'package.store',
            'uses' => 'PackageController@store',
        ]);

        $packageApi->put('/{id}', [
            'as'   => 'package.update',
            'uses' => 'PackageController@update',
        ]);

        $packageApi->delete('/{id}', [
            'as'   => 'package.update',
            'uses' => 'PackageController@update',
        ]);

        $packageApi->get('index', [
            'as'   => 'package.index',
            'uses' => 'PackageController@index',
        ]);

        $packageApi->get('/{id}', [
            'as'   => 'package.show',
            'uses' => 'PackageController@show',
        ]);

    });

    $api->get('test', function (Request $request) {
        return ['111'];
    });

});



